home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Java for 3D & VRML Worlds
/
Java for 3d and VRML Worlds.iso
/
examples
/
chap04
/
ProtoMan.wrl
< prev
next >
Wrap
Text File
|
1996-10-14
|
2KB
|
62 lines
#VRML V2.0 utf8
PROTO WalkingMan[ exposedField SFVec3f translation 0 0 0
exposedField SFRotation rotation 1 0 0 0
exposedField SFTime walkingCycle 1]{
Transform{
translation IS translation
rotation IS rotation
children[
DEF MAN Transform{
children[
LOD{
level[
Inline{url "ManDetailed.wrl"},
Inline{url "ManRough.wrl"}
]
range[10]
}
]
},
DEF MAN_TIME TimeSensor{
loop TRUE
cycleInterval IS walkingCycle
},
DEF MAN_POSINT PositionInterpolator{
key [0, 1]
keyValue [0 0 0, 0 0 10]
},
DEF MAN_SCRIPT Script{
url "ProtoMan.class"
eventIn SFTime cycleEnd
eventOut MFVec3f setPath
}
]
}
ROUTE MAN_TIME.fraction_changed TO MAN_POSINT.set_fraction
ROUTE MAN_POSINT.value_changed TO MAN.set_translation
ROUTE MAN_TIME.cycleTime TO MAN_SCRIPT.cycleEnd
ROUTE MAN_SCRIPT.setPath TO MAN_POSINT.set_keyValue
}
Viewpoint{
position 0 0 3
}
WalkingMan{
translation 0 0 -5
walkingCycle 3
}
WalkingMan{
translation 3 0 -8
walkingCycle 5
}
WalkingMan{
translation -3 0 -5
rotation 0 1 0 0.78
walkingCycle 7
}